<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class UserTableSeeder extends Seeder {
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run() {
        User::factory(10)->create();
        $user = User::find(1);
        $user->name = 'Jack';
        $user->email = 'Jack@qq.com';
        $user->avatar = url('fakers/faces/face1.jpg');
        $user->introduction = '天行健，君子当自强不息';
        $user->save();
        $user->assignRole('Founder');

        $user = User::find(2);
        $user->name = 'Tom';
        $user->email = 'Tom@qq.com';
        $user->avatar = url('fakers/faces/face2.jpg');
        $user->introduction = '三人行，必有我师';
        $user->save();
        $user->assignRole('Maintainer');

        $user = User::find(3);
        $user->name = 'Rose';
        $user->email = 'Rose@qq.com';
        $user->avatar = url('fakers/faces/face3.jpg');
        $user->introduction = '采菊东篱下，悠然望南山';
        $user->save();
    }
}
